<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //1、字符串几个新的API
        let str = "hello.vue"
        console.log(str.startsWith("hello"));
        console.log(str.endsWith(".vue"));
        console.log(str.includes("e"));
        console.log(str.includes("hello"));

        //2、字符串模板
        //1）、多行字符串
        let ss = `<div>
                     <span>Hello World</span>
                </div>`;
        console.log(ss)
        
        //2）、字符串插入变量和表达式。变量名写在${}中，${}中可以放入
        //JavaScript 表达式。
        let name = "张三";
        let age = 18;
        let info = `我是${name},今年${age}了`;
        console.log(info)

        //3）、字符串中调用函数
        function fun(){
            return "这是一个函数"
        }
        let sss = `O(∩_∩)O哈哈~,${fun()}`;
        console.log(sss)
    </script>
</head>
<body>
    
</body>
</html>